package Leason3;

import java.util.Scanner;

public class Task1 {

	public static void main(String[] args) {

		Scanner sc = new Scanner(System.in);
		System.out.println("Please enter a length of the array");
	int length = sc.nextInt();
	
		int number;
		
		int[] array = new int [length];
		
		int num = Integer.MAX_VALUE;
		int index = 0;
		
		for(int i = 0; i < array.length; i++ )
		{
			System.out.println("Please enter your " + (i+1) + " number");
			number = sc.nextInt();
			array[i] = number;
			
			if(number%3 == 0 && number < num && number>0)
			{
				index = i;
				num = number;
			}			
		}
		
		System.out.println("The smallest number multiple of 3 is " + array[index]);

		
		
		
		
	}

}
